#include "Voice_Control.h"




void Voice_Control(void)
{
	if(Voice_flag == 1)
	{
		if((Voice_PA0 == 1) && (Voice_PA1 == 1) && (Voice_PA2 == 1) && (Voice_PA3 == 1))
		{
			commandedX = -100;
			commandedY = 0;
			commandedR = 0;
			RxBuff[0] = 1;
		}
		if((Voice_PA0 == 0) && (Voice_PA1 == 1) && (Voice_PA2 == 1) && (Voice_PA3 == 1))
		{
			commandedX = 100;
			commandedY = 0;
			commandedR = 0;
			RxBuff[0] = 1;
		}
		if((Voice_PA0 == 0) && (Voice_PA1 == 0) && (Voice_PA2 == 1) && (Voice_PA3 == 1))
		{
			commandedX = 0;
			commandedY = 0;
			commandedR = 100;
			RxBuff[0] = 1;
		}
		if((Voice_PA0 == 0) && (Voice_PA1 == 0) && (Voice_PA2 == 0) && (Voice_PA3 == 1))
		{
			commandedX = 0;
			commandedY = 0;
			commandedR = -100;
			RxBuff[0] = 1;
		}
		if((Voice_PA0 == 1) && (Voice_PA1 == 1) && (Voice_PA2 == 0) && (Voice_PA3 == 1))
		{
			commandedX = 0;
			commandedY = 0;
			commandedR = 0;
			RxBuff[0] = 6;
		}
		if((Voice_PA0 == 0) && (Voice_PA1 == 0) && (Voice_PA2 == 0) && (Voice_PA3 == 0))
		{
			commandedX = 0;
			commandedY = 0;
			commandedR = 0;
			RxBuff[0] = 1;
		}
	}
}


